/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.mes.base.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.modules.mes.base.entity.MaterialInfo;
import org.springblade.modules.mes.base.entity.PrdBom;
import org.springblade.modules.mes.base.vo.PrdBomVO;
import org.springblade.modules.mes.base.vo.ScanItemVO;

import java.util.List;
import java.util.Map;

/**
 * 产品BOM信息 服务类
 *
 * @author BladeX
 * @since 2021-03-11
 */
public interface IPrdBomService extends BaseService<PrdBom> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param prdBom
	 * @return
	 */
	IPage<PrdBomVO> selectPrdBomPage(IPage<PrdBomVO> page, PrdBomVO prdBom);

	/**
	 * 新增BOM
	 * @param prdBomVO
	 * @return
	 */
	boolean saveBom(PrdBomVO prdBomVO);

	/**
	 * 删除BOM
	 * @param ids
	 * @return
	 */
	boolean deleteBoms(List<Long> ids);

	/**
	 * 更新BOM
	 * @param prdBomVO
	 * @return
	 */
	boolean updateBom(PrdBomVO prdBomVO);

	/**
	 * BOM详情
	 * @param id
	 * @return
	 */
	PrdBomVO getDetail(String id);

	/**
	 * 根据顶级编码查询一个完整BOM
	 * @param topProductNo
	 * @return
	 */
	List<PrdBomVO> listByTopNo(String topProductNo);

	List<PrdBomVO> getBomList(PrdBomVO prdBomVO);//生产接口获取所有有bom的产品信息
	List<PrdBomVO> getMaterialListByLeaderNo(PrdBomVO prdBomVO);//生产借口获取产品下一层物料信息
	List<PrdBomVO> getAMList();//获取所有辅助材料
	List<MaterialInfo> getMaterialList(List<String> list);

    List<Map<String,Object>> getBomByProductId(Long productId, String materialType);

    List<PrdBomVO> selectByTopNo(String productNo, String tenantId);
	List<PrdBomVO> selectByTopNoVw(String productNo);

    List<String> getParent(String materialNo);

    Map<String,Object> getBomStatus(String productNo);

    List<PrdBomVO> getQuota(String productNo);

	List<PrdBomVO> getUnConnectList();

	List<ScanItemVO> getScanList(String scanBarCode,String assemblyNo,String stationCode);
	List<ScanItemVO> getScanAllList(String scanBarCode,String assemblyNo,String stationCode);


}
